﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmProductoModificacion.aspx.cs" Inherits="frmProductoAlta" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 243px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

       <h1>Actualizar Producto<asp:Label ID="Label2" runat="server"></asp:Label>
       </h1>
       <p>&nbsp;</p>
       <p>RNPA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       </p>
       <p>
           <asp:TextBox ID="TextBox1" runat="server" Height="26px" Width="184px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       </p>
       <p>&nbsp;Denominacion</p>
       <p>
           <asp:TextBox ID="TextBox4" runat="server" Height="26px" Width="184px"></asp:TextBox>
       &nbsp; <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
               ControlToValidate="TextBox4" ErrorMessage="Ingrese denominacion"></asp:RequiredFieldValidator>
       </p>
       <p>&nbsp;Marca</p>
       <p>
           <asp:TextBox ID="TextBox2" runat="server" Width="184px" Height="26px"></asp:TextBox>
       &nbsp; <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
               ControlToValidate="TextBox2" ErrorMessage="Ingrese marca"></asp:RequiredFieldValidator>
       </p>
       <p>&nbsp;Nombre de Fantasia</p>
       <p>
           <asp:TextBox ID="TextBox3" runat="server" Width="184px" Height="26px"></asp:TextBox>
           &nbsp;
           <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
               ControlToValidate="TextBox3" ErrorMessage="Ingrese nombre de fantasia"></asp:RequiredFieldValidator>
       </p>
       <p>&nbsp;Seleccione Envase</p>
       <p>
           <asp:DropDownList ID="DropDownList1" runat="server" Height="28px" Width="184px" 
               DataSourceID="SqlDataSource1" DataTextField="presentacionEnvase" 
               DataValueField="idEnvase">
           </asp:DropDownList>
           <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
               ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
               SelectCommand="SELECT * FROM [T_Envase]"></asp:SqlDataSource>
           <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
               ConnectionString="<%$ ConnectionStrings:BD_SAFA_FINALConnectionString %>" 
               DeleteCommand="DELETE FROM [T_Empresa] WHERE [cuit] = @cuit" 
               InsertCommand="INSERT INTO [T_Empresa] ([cuit], [razonSocial], [nombreComercial], [dirCorreo], [dirWeb], [numTelefono], [idTipoTelefono], [idCondIva], [calle], [numeroCalle], [piso], [departamento], [codPostal], [idBarrio], [idLocalidad], [idProvincia], [idPais]) VALUES (@cuit, @razonSocial, @nombreComercial, @dirCorreo, @dirWeb, @numTelefono, @idTipoTelefono, @idCondIva, @calle, @numeroCalle, @piso, @departamento, @codPostal, @idBarrio, @idLocalidad, @idProvincia, @idPais)" 
               SelectCommand="SELECT [cuit], [razonSocial], [nombreComercial], [dirCorreo], [dirWeb], [numTelefono], [idTipoTelefono], [idCondIva], [calle], [numeroCalle], [piso], [departamento], [codPostal], [idBarrio], [idLocalidad], [idProvincia], [idPais] FROM [T_Empresa] where cuit = @cuit_empresa" 
               UpdateCommand="UPDATE [T_Empresa] SET [razonSocial] = @razonSocial, [nombreComercial] = @nombreComercial, [dirCorreo] = @dirCorreo, [dirWeb] = @dirWeb, [numTelefono] = @numTelefono, [idTipoTelefono] = @idTipoTelefono, [idCondIva] = @idCondIva, [calle] = @calle, [numeroCalle] = @numeroCalle, [piso] = @piso, [departamento] = @departamento, [codPostal] = @codPostal, [idBarrio] = @idBarrio, [idLocalidad] = @idLocalidad, [idProvincia] = @idProvincia, [idPais] = @idPais WHERE [cuit] = @cuit">
               <DeleteParameters>
                   <asp:Parameter Name="cuit" Type="String" />
               </DeleteParameters>
               <InsertParameters>
                   <asp:Parameter Name="cuit" Type="String" />
                   <asp:Parameter Name="razonSocial" Type="String" />
                   <asp:Parameter Name="nombreComercial" Type="String" />
                   <asp:Parameter Name="dirCorreo" Type="String" />
                   <asp:Parameter Name="dirWeb" Type="String" />
                   <asp:Parameter Name="numTelefono" Type="String" />
                   <asp:Parameter Name="idTipoTelefono" Type="Int32" />
                   <asp:Parameter Name="idCondIva" Type="Int32" />
                   <asp:Parameter Name="calle" Type="String" />
                   <asp:Parameter Name="numeroCalle" Type="String" />
                   <asp:Parameter Name="piso" Type="String" />
                   <asp:Parameter Name="departamento" Type="String" />
                   <asp:Parameter Name="codPostal" Type="String" />
                   <asp:Parameter Name="idBarrio" Type="Int32" />
                   <asp:Parameter Name="idLocalidad" Type="Int32" />
                   <asp:Parameter Name="idProvincia" Type="Int32" />
                   <asp:Parameter Name="idPais" Type="Int32" />
               </InsertParameters>
               <SelectParameters>
                   <asp:SessionParameter DefaultValue="0" Name="cuit_empresa" 
                       SessionField="codEmpresa" />
               </SelectParameters>
               <UpdateParameters>
                   <asp:Parameter Name="razonSocial" Type="String" />
                   <asp:Parameter Name="nombreComercial" Type="String" />
                   <asp:Parameter Name="dirCorreo" Type="String" />
                   <asp:Parameter Name="dirWeb" Type="String" />
                   <asp:Parameter Name="numTelefono" Type="String" />
                   <asp:Parameter Name="idTipoTelefono" Type="Int32" />
                   <asp:Parameter Name="idCondIva" Type="Int32" />
                   <asp:Parameter Name="calle" Type="String" />
                   <asp:Parameter Name="numeroCalle" Type="String" />
                   <asp:Parameter Name="piso" Type="String" />
                   <asp:Parameter Name="departamento" Type="String" />
                   <asp:Parameter Name="codPostal" Type="String" />
                   <asp:Parameter Name="idBarrio" Type="Int32" />
                   <asp:Parameter Name="idLocalidad" Type="Int32" />
                   <asp:Parameter Name="idProvincia" Type="Int32" />
                   <asp:Parameter Name="idPais" Type="Int32" />
                   <asp:Parameter Name="cuit" Type="String" />
               </UpdateParameters>
           </asp:SqlDataSource>
       </p>
       <p>
           <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
               ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
               DeleteCommand="DELETE FROM [T_DetalleComposicion] WHERE [idRNPA] = @idRNPA" 
               InsertCommand="INSERT INTO [T_DetalleComposicion] ([idRNPA], [idComponente], [cantidad], [unidad]) VALUES (@idRNPA, @idComponente, @cantidad, @unidad)" 
               SelectCommand="SELECT [idRNPA], [idComponente], [cantidad], [unidad], [idDetalle] FROM [T_DetalleComposicion]" 
               
               UpdateCommand="UPDATE [T_DetalleComposicion] SET [idRNPA] = @idRNPA, [idComponente] = @idComponente, [cantidad] = @cantidad, [unidad] = @unidad WHERE [idDetalle] = @idDetalle">
               <DeleteParameters>
                   <asp:Parameter Name="idRNPA" />
               </DeleteParameters>
               <InsertParameters>
                   <asp:Parameter Name="idRNPA" Type="Int32" />
                   <asp:Parameter Name="idComponente" Type="Int32" />
                   <asp:Parameter Name="cantidad" Type="String" />
                   <asp:Parameter Name="unidad" Type="Int32" />
               </InsertParameters>
               <UpdateParameters>
                   <asp:Parameter Name="idRNPA" Type="Int32" />
                   <asp:Parameter Name="idComponente" Type="Int32" />
                   <asp:Parameter Name="cantidad" Type="String" />
                   <asp:Parameter Name="unidad" Type="Int32" />
                   <asp:Parameter Name="idDetalle" Type="Int32" />
               </UpdateParameters>
           </asp:SqlDataSource>
       </p>
       <p>
           <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
               ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
               DeleteCommand="DELETE FROM [T_Producto] WHERE [idProducto] = @idProducto" 
               InsertCommand="INSERT INTO [T_Producto] ([nroRNPA], [nroRNE], [denominacion], [marca], [fantasia], [codEnvase], [infoCompl], [marcoLegal], [tecnicaElab], [deterioro], [ensayo], [conserv], [aptitud], [modo]) VALUES (@nroRNPA, @nroRNE, @denominacion, @marca, @fantasia, @codEnvase, @infoCompl, @marcoLegal, @tecnicaElab, @deterioro, @ensayo, @conserv, @aptitud, @modo)" 
               SelectCommand="SELECT [nroRNPA], [nroRNE], [denominacion], [marca], [fantasia], [codEnvase], [idProducto], [infoCompl], [marcoLegal], [tecnicaElab], [deterioro], [ensayo], [conserv], [aptitud], [modo] FROM [T_Producto]" 
               
               UpdateCommand="UPDATE [T_Producto] SET [nroRNPA] = @nroRNPA, [nroRNE] = @nroRNE, [denominacion] = @denominacion, [marca] = @marca, [fantasia] = @fantasia, [codEnvase] = @codEnvase, [infoCompl] = @infoCompl, [marcoLegal] = @marcoLegal, [tecnicaElab] = @tecnicaElab, [deterioro] = @deterioro, [ensayo] = @ensayo, [conserv] = @conserv, [aptitud] = @aptitud, [modo] = @modo WHERE [idProducto] = @idProducto">
               <DeleteParameters>
                   <asp:Parameter Name="idProducto" Type="Int32" />
               </DeleteParameters>
               <InsertParameters>
                   <asp:Parameter Name="nroRNPA" Type="String" />
                   <asp:Parameter Name="nroRNE" Type="Int32" />
                   <asp:Parameter Name="denominacion" Type="String" />
                   <asp:Parameter Name="marca" Type="String" />
                   <asp:Parameter Name="fantasia" Type="String" />
                   <asp:Parameter Name="codEnvase" Type="Int32" />
                   <asp:Parameter Name="infoCompl" Type="String" />
                   <asp:Parameter Name="marcoLegal" Type="String" />
                   <asp:Parameter Name="tecnicaElab" Type="String" />
                   <asp:Parameter Name="deterioro" Type="String" />
                   <asp:Parameter Name="ensayo" Type="String" />
                   <asp:Parameter Name="conserv" Type="String" />
                   <asp:Parameter Name="aptitud" Type="String" />
                   <asp:Parameter Name="modo" Type="String" />
               </InsertParameters>
               <UpdateParameters>
                   <asp:Parameter Name="nroRNPA" Type="String" />
                   <asp:Parameter Name="nroRNE" Type="Int32" />
                   <asp:Parameter Name="denominacion" Type="String" />
                   <asp:Parameter Name="marca" Type="String" />
                   <asp:Parameter Name="fantasia" Type="String" />
                   <asp:Parameter Name="codEnvase" Type="Int32" />
                   <asp:Parameter Name="infoCompl" Type="String" />
                   <asp:Parameter Name="marcoLegal" Type="String" />
                   <asp:Parameter Name="tecnicaElab" Type="String" />
                   <asp:Parameter Name="deterioro" Type="String" />
                   <asp:Parameter Name="ensayo" Type="String" />
                   <asp:Parameter Name="conserv" Type="String" />
                   <asp:Parameter Name="aptitud" Type="String" />
                   <asp:Parameter Name="modo" Type="String" />
                   <asp:Parameter Name="idProducto" Type="Int32" />
               </UpdateParameters>
           </asp:SqlDataSource>
       <p>&nbsp;<p>
           <asp:Label ID="Label1" runat="server"></asp:Label>
       </p>
       <p>
       <br />
           <asp:Button ID="Button1" runat="server" Height="29px" onclick="Button1_Click" 
               Text="Actualizar Composicion" Width="156px" />
       &nbsp;&nbsp;&nbsp;
           <asp:Button ID="Button3" runat="server" Height="29px" Text="Actualizar Monografía" 
               Width="154px" CausesValidation="False" onclick="Button3_Click" />
       </p>
       <p>&nbsp;</p>
       <p>
           <asp:Button ID="Button5" runat="server" Height="48px" Text="Actualizar Producto" 
               Width="155px" onclick="Button5_Click" />
&nbsp;&nbsp;&nbsp;
           <asp:Button ID="Button4" runat="server" Height="46px" Text="Cancelar " 
               Width="156px" CausesValidation="False" onclick="Button4_Click" />
       </p>
       <p>
           &nbsp;</p>
       <p>
           <asp:Button ID="Button6" runat="server" CausesValidation="False" Height="33px" 
               onclick="Button6_Click" Text="Listado de Productos del establecimiento" 
               Width="331px" />
       </p>
       <p></p>
       <p>
           <table style="width:100%;">
               <tr>
                   <td class="style1">
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
               </tr>
               <tr>
                   <td class="style1">
                       <br />
                       Opciones de documentacion</td>
                   <td>
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
               </tr>
               <tr>
                   <td class="style1">
                       <asp:CheckBox ID="CheckBox1" runat="server" Enabled="False" 
                           Text="Monografia de Producto" />
                   </td>
                   <td>
                       <asp:Button ID="Button7" runat="server" CausesValidation="False" Height="26px" 
                           onclick="Button7_Click" Text="Generar" Width="88px" />
                   </td>
                   <td>
                       &nbsp;</td>
               </tr>
               <tr>
                   <td class="style1">
                       <asp:CheckBox ID="CheckBox2" runat="server" Enabled="False" 
                           Text="Rotulo del producto" />
                   </td>
                   <td>
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
               </tr>
           </table>
       </p>
       <p>&nbsp;</p> 
</asp:Content>

